<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="com.qifan.alb2b.domain.CountryInfoDomain"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>易能旅游网站--密码修改</title>
	<%@ include file="/pages/common/common_f.jsp" %>	
	<link rel="stylesheet" type="text/css" href="${ctx}/css/register.css" />
	<script type="text/javascript">
		//写注册验证
		
		$(function(){
		$("#password2").blur(function(){
			if($(this).val()==$("#password1").val()){
			document.getElementById("passwordfail").style.display="none";
			} else {
			document.getElementById("passwordfail").style.display="";
			}
		})	
	})
	
	
	/** 更新 */
	function updatePassword(){
		var r = $('#passwordForm').form('validate'); 
		if(!r) {
			return false;
		}
		var url="${ctx}/userCenter/updatePassword.usr";
		
		$.post(url,$("#passwordForm").serializeArray(),function(data){
			if(data.success){//操作成功
				$.messager.alert('提示','操作成功','info');
				$('#passwordForm').form('clear');
			}else{
				$.messager.alert('提示',data.msg,'warning');	
			}
		});
	}
/** 清空查询条件 */
	function clearForm(){
		$('#passwordForm').form('clear');
		//searchUser();
	}
	</script>	
  </head>
 <body style="margin:0;padding:0;height:100%;overflow:scroll;background:#F2FBFF">
  	<div class="main">
		<jsp:include page="/pages/front/inc/header.jsp"></jsp:include><!-- 顶部导航 -->
		<div class="info">
			<span class="location"><span style="font-weight: bold;">位置：</span>首页>用户中心>密码修改</span>
			<span class="user"><jsp:include page="/pages/front/inc/login_info.jsp"/></span>
		</div>
		<div class="content">
			<div class="left">
				<jsp:include page="/pages/front/user/left_model.jsp"></jsp:include>
			</div>
			<div class="right" id="right">
  <form class="auform" id="passwordForm" method="post">
  <div id="register_div" style="margin: 5px;width: 730px;">
  	<h2>密码修改</h2>
	<div class="info_div">
		<div class="info_content">
			<table align="center">
				<tr>
				<td class="autd1">原密码：</td>
				<td class="autd2"><input name="password" id="password" type="password" style="width:150px" validType="length[6,30]" class="easyui-validatebox txt" required="true"><span class="red">*</span></td>
				
				</tr><tr><td class="autd1">新密码 :</td>
				<td class="autd2"><input name="password1" id="password1" type="password" style="width:150px" validType="length[6,30]" class="easyui-validatebox txt" required="true"><span class="red">*</span></td>
				</tr>
				<tr>
				<td class="autd1">重复密码：</td>
				<td class="autd2"><input name="password2" id="password2"  type="password" style="width:150px" validType="length[6,30]" class="easyui-validatebox txt" required="true"><span class="red">*</span>
				
				</td>
				
				</tr>
				<tr>
				<td>&nbsp;</td>
				<td><span style=display:none id="passwordfail"><font color="red">两次输入密码不一致</font></span></td></tr>
			</table>
		</div>
	</div>
	
	<div class="btn_div">
		<a href="#" id="btn-add"
							onclick="clearForm();"
							class="easyui-linkbutton" iconCls="icon-cancel">重填</a>&nbsp;
		<a href="#" id="btn-add"
							onclick="updatePassword();"
							class="easyui-linkbutton" iconCls="icon-save">修改密码</a>
	</div>
</div>
</form>
</div><!-- end right -->
			<div class="vertical-border"></div><!-- center border-line -->
		</div><!-- end content -->
	</div><!-- end main -->
	

</body>

</html>